package 常用类.day2.复习;

public class Test {
    public static void main(String[] args) {
        Person p=new Stu();
        System.out.println(p.age);
        p.show();
        new Test().eat(new Stu());
    }


    Stu catStu(){
        return new Stu();
    }

    Doctor catD(){
        return new Doctor();
    }

    Person catPerson(int i){
        if(i==0){
            return new Stu();
        }else if(i==1){
            return new Doctor();
        }else {
            return new Person();
        }
    }

    void eat(Person p){
        p.show();
    }
}
